package cn.hchaojie.camp.day05.oop;

public abstract class Shape {
	private Point center;
	/**
	 * 求面积
	 * 抽象方法：只有方法声明，没有方法实现
	 * 
	 * 你知道子类一定有某个功能，但是父类不知道如何实现，
	 * 
	 * 需要由子类去实现
	 * 
	 * @return
	 */
	public abstract double getArea();
	
	public Point getCenter() {
		return center;
	}

	public void setCenter(Point center) {
		this.center = center;
	}
	
	public void print() {
		System.out.println("Shape.print()...");
	}

	public static class Point {
		private double x;
		private double y;

		public Point(double x, double y) {
			this.x = x;
			this.y = y;
		}

		public double getX() {
			return x;
		}

		public void setX(double x) {
			this.x = x;
		}

		public double getY() {
			return y;
		}

		public void setY(double y) {
			this.y = y;
		}
	}
}
